import request from '@/utils/request'

// 查询论文列表
export function getPaperList(params) {
  return request({
    url: '/product/infoApi/list',
    method: 'get',
    params
  })
}

// 查询论文详情
export function getPaperDetail(productUid) {
  return request({
    url:`/product/infoApi/${productUid}`,
    method: 'get'
  })
}

// 职称论文列表
export function getTitlePaperList() {
  return request({
    url: '/product/infoApi/zhiCheng',
    method: 'get',
  })
}

// 其他论文列表
export function getOtherPaperList() {
  return request({
    url: '/product/infoApi/otherLuwn',
    method: 'get'
  })
}

// 批量收藏论文
export function battleCollectPaper(lunwenUids) {
    return request({
        url: `/customer/openCustomercollect/batchAdd/${lunwenUids}`,
        method: 'post',
    })
}

// 扫码购买积分
export function scanCodeBuyIntegral(data) {
  return request({
    url: '/order/openOrder/rechargeMoney',
    method: 'post',
    data
  })
}

// 下载论文
export function downloadPaper(productId) {
  return request({
    url: `/order/openOrder/download/${productId}`,
    method: 'post'
  })
}

// 买断论文
export function buyOutPaper(productId) {
  return request({
    url: `/order/openOrder/maiduan/${productId}`,
    method: 'post',
  })
}

// 批量下载论文
export function batchDownloadPaper(data) {
  return request({
    url: `/order/openOrder/batchDownload`,
    method: 'post',
    data
  })
}

// 获取用户收藏列表
export function getUserCollectList(params) {
  return request({
    url: '/customer/openCustomercollect/getCustomerAllCollect',
    method: 'get',
    params
  })
}

// 收藏论文/取消收藏
export function changeCollect(data) {
    return request({
        url: `/customer/openCustomercollect/editCollectStatus`,
        method: 'post',
        data
    })
}

// 查询订单支付结果
export function getOrderPayResult(orderNo) {
  return request({
    url: `/order/openOrder/payStatus/${orderNo}`,
    method: 'get'
  })
}
